package Presentacion;

import de.javasoft.plaf.synthetica.SyntheticaLookAndFeel;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import javax.swing.ButtonGroup;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;

public class OpcionesReportes extends javax.swing.JFrame {

    static ButtonGroup grupo = new ButtonGroup();
    private static OpcionesReportes instancia = null;
    DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");

    public static OpcionesReportes obtenerInstancia() {
        if (instancia == null) {
            instancia = new OpcionesReportes();
        }
        return instancia;
    }

    public OpcionesReportes() {
        initComponents();
        grupo.add(jRadioButtonTardia);
        grupo.add(jRadioButtonGeneralPlanilla);
        grupo.add(jRadioButtonPlanillaEmpleado);
        grupo.add(jRadioButtonCaja);
        grupo.add(jRadioButtonBanco);
    }

    public void init() {
        setTitle("Reportes");
        setLocationRelativeTo(null);
        UIManager.removeAuxiliaryLookAndFeel(UIManager.getLookAndFeel());
        SwingUtilities.updateComponentTreeUI(this);
        try {
            UIManager.removeAuxiliaryLookAndFeel(UIManager.getLookAndFeel());
            SyntheticaLookAndFeel.setWindowsDecorated(false);
            UIManager.setLookAndFeel("de.javasoft.plaf.synthetica.SyntheticaAluOxideLookAndFeel");
            SwingUtilities.updateComponentTreeUI(this);

        } catch (Exception ex) {
            try {
                UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

        this.setVisible(true);
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jRadioButtonTardia = new javax.swing.JRadioButton();
        jRadioButtonGeneralPlanilla = new javax.swing.JRadioButton();
        jRadioButtonPlanillaEmpleado = new javax.swing.JRadioButton();
        jButton1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        jRadioButtonCaja = new javax.swing.JRadioButton();
        jRadioButtonBanco = new javax.swing.JRadioButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setMinimumSize(new java.awt.Dimension(500, 250));
        setResizable(false);

        jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        jRadioButtonTardia.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        jRadioButtonTardia.setText("Reporte de tardías.");
        jRadioButtonTardia.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jRadioButtonTardiaActionPerformed(evt);
            }
        });

        jRadioButtonGeneralPlanilla.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        jRadioButtonGeneralPlanilla.setText("Reporte general de planilla.");

        jRadioButtonPlanillaEmpleado.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        jRadioButtonPlanillaEmpleado.setText("Reporte de planilla por empleado.");

        jButton1.setText("Ver");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jButton2.setText("Salir");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        jLabel1.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel1.setText("Elija el reporte que desea ver: ");

        jRadioButtonCaja.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        jRadioButtonCaja.setText("Reporte de la CCSS.");

        jRadioButtonBanco.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        jRadioButtonBanco.setText("Reporte Bancario.");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jRadioButtonBanco)
                        .addGap(113, 258, Short.MAX_VALUE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jRadioButtonCaja)
                                    .addComponent(jLabel1)
                                    .addComponent(jRadioButtonGeneralPlanilla)
                                    .addComponent(jRadioButtonPlanillaEmpleado)
                                    .addComponent(jRadioButtonTardia))
                                .addGap(0, 0, Short.MAX_VALUE))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                                .addGap(0, 0, Short.MAX_VALUE)
                                .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGap(18, 18, 18)
                        .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(47, 47, 47))))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addGap(18, 18, 18)
                .addComponent(jRadioButtonTardia)
                .addGap(18, 18, 18)
                .addComponent(jRadioButtonGeneralPlanilla)
                .addGap(18, 18, 18)
                .addComponent(jRadioButtonPlanillaEmpleado, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jRadioButtonCaja)
                .addGap(18, 18, 18)
                .addComponent(jRadioButtonBanco)
                .addGap(14, 14, 14)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton1)
                    .addComponent(jButton2))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 282, Short.MAX_VALUE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        dispose();
    }//GEN-LAST:event_jButton2ActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        // muestra reporte respectivo !!!!
        if (jRadioButtonTardia.isSelected()) {
            Tardias repTardia = Tardias.obtenerInstancia();
            repTardia.init();
        } else if (jRadioButtonGeneralPlanilla.isSelected()) {
            OpcionesReportesPlanillaGeneral ventana = OpcionesReportesPlanillaGeneral.obtenerInstancia();
            ventana.init();
        } else if (jRadioButtonPlanillaEmpleado.isSelected()) {
            OpcionesReportesPlanillaEmpleado ventana = OpcionesReportesPlanillaEmpleado.obtenerInstancia();
            ventana.init();
            //OpcionesReportesPlanillaGeneral
        } else if (jRadioButtonCaja.isSelected()) {

            OpcionesReportesCaja ventana = OpcionesReportesCaja.obtenerInstancia();
            ventana.init();
            //generarReporteGeneralCaja(1);
        } else {
            OpcionesReporteBanco ventana = OpcionesReporteBanco.obtenerInstancia();
            ventana.init();
        }

    }//GEN-LAST:event_jButton1ActionPerformed

    private boolean generarReporteGeneralBanco() {
        return true;
    }
    private void jRadioButtonTardiaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioButtonTardiaActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jRadioButtonTardiaActionPerformed

    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(OpcionesReportes.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(OpcionesReportes.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(OpcionesReportes.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(OpcionesReportes.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new OpcionesReportes().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JRadioButton jRadioButtonBanco;
    private javax.swing.JRadioButton jRadioButtonCaja;
    private javax.swing.JRadioButton jRadioButtonGeneralPlanilla;
    private javax.swing.JRadioButton jRadioButtonPlanillaEmpleado;
    private javax.swing.JRadioButton jRadioButtonTardia;
    // End of variables declaration//GEN-END:variables
}
